<include file="Index/header"/>
<script language="javascript" type="text/javascript" src="__PUBLIC__/My97DatePicker/WdatePicker.js"></script>
<style> 
.teacher {
    margin-left: 20px;   
    border:solid 1px #ccc;
    
        
    }    
    .teacher td{
        height:50px;
        margin-left: 20px;
        width:500px;
        border:solid 1px #ccc;
        line-height: 50px;
    }
    .teacher select{
        width:80px;
        margin-left: 20px; 
    }
     .teacher  label{
        
     margin-left: 20px;   
        
    }
   .teacher  input{
     width:100px;  
     margin-left: 20px;   
        
    }
       .input-xlarge{
      width:600px;
      height:100px;
        
        
    }    .bc{
       width:300px;  
        
    }
    </style>
  <include file="Index/left"/>
    
    
    <div class="content">
        
        <div class="header">
            
            <h1 class="page-title">录入学员资料</h1>
        </div>
        
                <ul class="breadcrumb">
            <li><a href="{:U('Index/Index')}">首页</a> <span class="divider">/</span></li>
            <li><a href="#">档案管理</a> <span class="divider">/</span></li>
            <li class="active">学员信息管理</li>
        </ul>

        <div class="container-fluid">
            <div class="row-fluid">
                    

<div class="well" id='well2'>
    <ul class="nav nav-tabs">
      <li class="active"><a href="#home" data-toggle="tab">添加学员信息</a></li>

    </ul>
    <div id="myTabContent" class="tab-content">
      <div class="tab-pane active in" id="home">
          <form id="tab" >
                 <table width="800px" border="0" class="teacher">
                     <tr>
        <td>&nbsp;&nbsp;学员号
        <input type="text" value="" name="userid" id="userid" class="input-xlarge" style="width:120px;" maxlength="9"></td>
        <td>&nbsp;&nbsp;姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名
        <input type="text" value="" id="loginname" name="loginname" class="input-xlarge" style="width:120px;"></td>
        <td>&nbsp;&nbsp;性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别
            <select name="sex" id="sex" style="width:135px;">
    
          <option value="男">男</option>
          <option value="女">女</option>
          </select></td>
                 </tr>
                 <tr>
                     <td>
        &nbsp;&nbsp;班&nbsp;&nbsp;&nbsp;&nbsp;次
        <select name="classid" id="classid" style="width:135px;">
    <volist name="classs" id="va">
          <option value="{$va.scheid}">{$va.scheid}</option>
    </volist>
          </select></td>
          <td> &nbsp;&nbsp;民&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;族
              <input type="text" value="" name="nation" class="input-xlarge" style="width:120px;"></td>
          <td>&nbsp;&nbsp;所在单位
              <input type="text" value="" name="Company" class="input-xlarge" style="width:120px;"></td></tr>
                 <tr>
        <td>&nbsp;&nbsp;职&nbsp;&nbsp;&nbsp;&nbsp;务
        <input type="text" value="" name="Political" class="input-xlarge" style="width:120px;"></td>
        <td> &nbsp;&nbsp;出生日期
        <input type="text" value="" name="Birth" class="input-xlarge" style="width:120px;" onClick="WdatePicker()"></td>
        <td>&nbsp;&nbsp;身份证号
            <input type="text" value="" name="IDcard" class="input-xlarge" style="width:120px;"></td></tr>
                 <tr>
       <td> &nbsp;&nbsp;电&nbsp;&nbsp;&nbsp;&nbsp;话
        <input type="text" value="" name="telephone" class="input-xlarge"style="width:120px;"></td>
       <td> &nbsp;&nbsp;电子邮件
        <input type="text" value="" name="email" class="input-xlarge" style="width:120px;"></td>
       <td>&nbsp;&nbsp;学员级别
                <select name="level" id="level" style="width:135px;">
                    
   <volist name="stulb" id="vb">
          <option value="{$vb.dict_name}">{$vb.dict_name}</option>
    </volist>
                </select></td></tr>
       <tr><td colspan="3">  &nbsp; 备&nbsp;&nbsp;&nbsp;&nbsp;注&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
               <textarea name="remark" cols="50" rows="6" id="remark" class="input-xlarge"></textarea></td></tr>
      <!-- <tr><td colspan="3">   备&nbsp;&nbsp;&nbsp;&nbsp;注2:&nbsp;&nbsp;&nbsp;&nbsp;
               <textarea cols="50" rows="6" name="crc" class="input-xlarge"></textarea></td></tr>--></table>
        <table>
        <br />
        <div style="margin-left:280px;">  <button  type="button" class="btn btn-primary" onclick="tj()">确&nbsp;&nbsp;&nbsp;&nbsp;定</button>&nbsp;&nbsp;&nbsp;&nbsp;
		<button type="button" class="btn btn-primary"  onclick="history.go(-1)">取&nbsp;&nbsp;&nbsp;&nbsp;消</button></div>
    </form>
      </div>
  
      </div>
  </div>

</div>



                    
                    <footer>
                        <hr>

                    
                    </footer>
                    
            </div>
        </div>
    </div>
   <script type="text/javascript">  
function tj(){
var tid=$('#userid').val();
var tname=$('#loginname').val();
var remark=$('#remark').val().length;
if(remark>100){
    
   alert('备注超过最大字数限制'); 
   return
}
if(tid === ''){
    alert('学员编号不能为空');
  $("#userid").focus();  
    return;
}
else if(tname === ''){
        alert('学员姓名不能为空');
  $("#loginname").focus();  
    return;
    
}

   $.ajax({
                type: "POST",
                url: "__CONTROLLER__/Addstudent",
           
                cache: false,
                data: $('#tab').serialize(),
         
                    success: function(data) {
                switch(data){
                           
                case '0':
                     alert('用户添加成功');
            if(confirm("是否继续添加学员信息")){
          location.href="__CONTROLLER__/Addstudent";
      }else{
         window.location.replace("__CONTROLLER__/Student") 
      }
               
                
                break;
                case '1': 
                 alert('用户添加失败');
           
                break;
        case '3':
                alert('学员编号已存在');
                break;
            default:
                alert(data);
        }
              
                       }
                    
        
        
        
        })

    
}
</script>

    <script src="__PUBLIC__/lib/bootstrap/js/bootstrap.js"></script>
    <script type="text/javascript">
        $("[rel=tooltip]").tooltip();
        $(function() {
            $('.demo-cancel-click').click(function(){return false;});
        });
    </script>
    
  </body>
</html>


